import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';

Vue.config.productionTip = false;

import 'normalize.css/normalize.css'; //css resets
import './icons'; //icon
import './permission'; // 路由导航守卫
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import '@/styles/index.scss'; // global css
Vue.use(Antd);

/**组件全局化 */
import Plugin from '@/plugins';
Plugin();
/**全局处理字典 */
import dicts from '@/utils/dicts';
Vue.use(dicts);

/**按钮权限判断 */
import { hasBtnPermission } from '@/utils/permission';
// Vue.use(hasPermission)
Vue.prototype.hasPerm = hasBtnPermission;

import scrollBar from '@/components/scrollBar';
import '@/components/scrollBar/index.scss';
Vue.component('scroll-bar', scrollBar);

// import loading from '@/components/loading/loading'; // 引入loading
// Vue.use(loading); // 全局使用loading

import AMap from 'vue-amap';

Vue.use(AMap);
AMap.initAMapApiLoader({
    key: '53e7671d5804cde97b90532ce6365c81',
    plugin: [
        'AMap.Scale',
        'AMap.OverView',
        'AMap.ToolBar',
        'AMap.PolyEditor',
        'AMap.MapType',
        'AMap.PlaceSearch',
        'AMap.Autocomplete',
        'AMap.CircleEditor',
        'AMap.MouseTool',
        'AMap.PolygonEditor',
        'AMap.MouseTool'
    ],
    v: '1.4.4',
    viewMode: '3D'
});

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app');
